package me.zhengjie.modules.app.mapstruct;

import java.util.List;

public interface BaseModelDtoMapStruct <T, DTO>{
    /*//改方式解决实体类Id是long，dto是字符串
    @Mappings({
            @Mapping(target = "id", expression = "java(String.valueOf(entity.getId()))")
    })
    DTO fromModel2Dto(T entity);

    @Mappings({
            @Mapping(target = "id", expression = "java(Long.parseLong(dto.getId()))")
    })
    T fromDto2Model(DTO dto);*/


    DTO fromModel2Dto(T entity);

    T fromDto2Model(DTO dto);

    List<DTO> fromModel2Dtos(List<T> entities);

    List<T> fromDtos2Model(List<DTO> dtos);

}